#include <iostream>
#include <string>
#include <sstream>


/**
 * 单词倒排
 */
int main() {
	std::string strs[100]{};

	std::string str;
	std::getline(std::cin, str);

	std::stringstream ss(str);

	std::string word;
	int idx = 0;
	while(ss >> word) {
		strs[idx++] = word;
	}

	for (int i=idx-1; i>=0; i--) {
		std::cout << strs[i] << " ";
	}

	return 0;
}